//
//  XmppClient.h
//  MoCard
//
//  Created by 水石 温 on 11-9-16.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AsyncSocket.h"
#import "XMPPParser.h"

#import "DDXML.h"

//网络事件回调
@protocol NetEventHandlerDelegate
@required
-(void)didConnect;
-(void)streamDidOpen:(DDXMLElement *)root;
-(void)didReadElement:(DDXMLElement*)xmlElement;
-(void)didDisconnect;
-(void)networkStateChanged;
@end

/*底层网络事件处理类，只能与XmppClient交互*/
@interface NetEventHandler : NSObject {
    AsyncSocket *socket;
    XMPPParser *xmlParser;
}
/*++++++++++提供给XmppClient调用的方法+++++++++++++*/

-(void)connectToHost:(NSString*)ip onPort:(NSInteger)aPort;
-(void)sendString:(NSString*)str;
-(void)sendElement:(DDXMLElement*)xmlElement;
-(BOOL)isConnected;
-(void)disconnect;
/*返回当前网络类型，gprs或者wifi*/
-(NSString*)currentNetworkType;

/*+++++++++++++++++++++++++++++++++++++++++++++*/


@end
